/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.crm.cs.entity.CommonQuestionType
   Module Description   :

   Date Created      : 2009/12/2
   Original Author   : andy.chuang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.crm.cs.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 * @author andy.chuang
 *
 */
@Entity
@Table(name="CRM_CS_COMMONQUESTION_TYPE")
public class CommonQuestionType implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 4644922529677560739L;
    private String id;
    private String name;
    private String description;
    private CommonQuestionType parent;
    private List<CommonQuestionType> childs;
    private String workFlowName;
    private Boolean showOnQAA=true;
    private Integer sortOrder=0;

    /**
     * @return the sortOrder
     */
    public Integer getSortOrder() {
        return sortOrder;
    }
    /**
     * @param sortOrder the sortOrder to set
     */
    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }
    /**
     * @return the showOnQAA
     */
    public Boolean getShowOnQAA() {
        return showOnQAA;
    }
    /**
     * @param showOnQAA the showOnQAA to set
     */
    public void setShowOnQAA(Boolean showOnQAA) {
        this.showOnQAA = showOnQAA;
    }
    /**
     * @return the id
     */
    @Id
    @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name="system-uuid", strategy="uuid")
    @Column(length=32)
    public String getId() {
        return id;
    }
    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }
    /**
     * @return the name
     */
    @Column(length=100)
    public String getName() {
        return name;
    }
    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * @return the description
     */
    @Column(length=400)
    public String getDescription() {
        return description;
    }
    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
    /**
     * @return the parent
     */
    @ManyToOne
    public CommonQuestionType getParent() {
        return parent;
    }
    /**
     * @param parent the parent to set
     */
    public void setParent(CommonQuestionType parent) {
        this.parent = parent;
    }
    /**
     * @return the childs
     */
    @LazyCollection(LazyCollectionOption.FALSE)
    @OneToMany(targetEntity=CommonQuestionType.class, mappedBy="parent")
    @OrderBy(value="id asc")
    public List<CommonQuestionType> getChilds() {
        return childs;
    }
    /**
     * @param childs the childs to set
     */
    public void setChilds(List<CommonQuestionType> childs) {
        this.childs = childs;
    }
    /**
     * @return the workFlowName
     */
    public String getWorkFlowName() {
        return workFlowName;
    }
    /**
     * @param workFlowName the workFlowName to set
     */
    public void setWorkFlowName(String workFlowName) {
        this.workFlowName = workFlowName;
    }
    

}
